# -*- coding: utf-8 -*-
# -*- frozen_string_literal: true -*-

<%= @scaffold.sublevel_require_minitest_config %>
require "<%= @scaffold.gem_path %>/doc"

# Tests w/ assert_respond_to show we care about the method existing not what's
# returned, nor it's type. The type is implicitly check by building a gem w/o
# warnings. There's a test for that.
class Test<%= @scaffold.gem_namespace %>Doc < Minitest::Test
  parallelize_me!

  def test_has_summary
    assert_respond_to <%= @scaffold.namespace %>::Doc, :summary
  end

  def test_has_description
    assert_respond_to <%= @scaffold.namespace %>::Doc, :description
  end

  def test_has_build_options
    assert_respond_to <%= @scaffold.namespace %>::Doc, :build_options
  end

  def test_documented_files_are_listed_in_the_manifest
    manifest = <%= @scaffold.namespace %>::Manifest.files
    <%= @scaffold.namespace %>::Doc.files.each { |f| assert_includes manifest, f }
  end

  def test_appendices_are_among_files_listed_in_the_manifest
    manifest = <%= @scaffold.namespace %>::Manifest.files
    <%= @scaffold.namespace %>::Doc.appendices.each { |a| assert_includes manifest, a }
  end
end
